import Cookies from 'js-cookie'
// 获取用户token
const TokenKey = 'Admin-Token'
const userIds = 'User-Id'
const userName = 'User-Name'
const UserName = 'userNameUsercenter'
const UserRole = 'userRoleUserCenter'
// token
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
// userId
export function setUserId(userId) {
  return Cookies.set(userIds, userId)
}

export function getUserId() {
  return Cookies.get(userIds)
}

// userName
export function setUserName(username) {
  return Cookies.set(userName, username)
}

export function getUserName() {
  return Cookies.get(userName)
}

const UrlKey = 'url'

export function getUrl() {
  return Cookies.get(UrlKey)
}

export function setUrl(url) {
  return Cookies.set(UrlKey, url)
}

export function removeUrl() {
  return Cookies.remove(UrlKey)
}

export function getUser() {
  return Cookies.get(UserName)
}

export function setUser(token) {
  return Cookies.set(UserName, token)
}

export function removeUser() {
  return Cookies.remove(UserName)
}

export function getRole() {
  return Cookies.get(UserRole)
}

export function setRole(token) {
  return Cookies.set(UserRole, token)
}

export function removeRole() {
  return Cookies.remove(UserRole)
}
